﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hugo
{
    class Inbox
    {
        private static List<InboxMessage> messages = new List<InboxMessage>();

        public static void addMessage(InboxMessage message)
        {
            messages.Add(message);
        }

        public static List<InboxMessage> getLastMessages(int last) {
            if (messages.Count <= last)
            {
                return messages;
            }
            else
            {
                return messages.GetRange(messages.Count - last, last);
            }
        }

        public class InboxMessage
        {
            public String from { get; set; }
            public String msg;
            public String timeStamp;

            public InboxMessage(String from, String msg, String timeStamp)
            {
                this.from = from;
                this.msg = msg;
                this.timeStamp = timeStamp;
            }
        }
    }
}
